/**
 * 
 */
package com.googlecode.dynargs.test.data;

import java.util.Arrays;
import java.util.Date;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

import com.googlecode.dynargs.model.annotation.Field;


/**
 * @author Federico De Faveri defaveri@gmail.com
 *
 */
public class Person {
	
	@Field(label="Name")
	@NotNull
	protected String name;
	
	@Field(label="Surname")
	@NotNull
	protected String surname;
	
	@Field(label="Birth date")
	protected Date birthDate;
	
	@Field(label="Age")
	@Min(0)
	@Max(130)
	protected int age;
	
	@Field(label="Sex")
	protected Sex sex;
	
	@Field(label="Address 1")
	protected Address addresses1;
	
	@Field(label="Address 2")
	protected Address addresses2;
	
	@Field(label="Phone numbers")
	protected Integer[] phoneNumbers;

	/**
	 * {@inheritDoc}
	 */
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("Person [name=");
		builder.append(name);
		builder.append(", surname=");
		builder.append(surname);
		builder.append(", age=");
		builder.append(age);
		builder.append(", sex=");
		builder.append(sex);
		builder.append(", addresses1=");
		builder.append(addresses1);
		builder.append(", addresses2=");
		builder.append(addresses2);
		builder.append(", phoneNumbers=");
		builder.append(Arrays.toString(phoneNumbers));
		builder.append("]");
		return builder.toString();
	}
}
